<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/jedate.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/fonts/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/common.css"/>
		
	</head>
	<body>
		<div class="container-fluid">
			<div class="row mheader">
				<div class="col-xs-2 text-left"><a href="javascript:;" onclick="javascript:history.back(-1);"><span class="iconfont icon-fanhui"></span></a></div>
				<div class="col-xs-8"><h2>材料供应查询统计</h2></div>
				<div class="col-xs-2 text-right"><!-- <a href="#">编辑</a> --></div>
			</div>
			<div class="row">
				<dl id="dd1" class="erp-list erp-details">

				</dl>
				
				<!--<dl id="dd2" class="erp-list erp-details">-->

				<!--</dl>-->

				<dl id="dd3" class="erp-order">
					<dt>材料供应单</dt>

				
				</dl>
			
				<!--<div style="margin-bottom: 80px;"></div>-->
				<!--<div class="order-send"><a href="erp-order.html" class="btn btn-warning">发货</a></div>-->

			</div>
		</div>
	</body>
</html>
<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="../../../resource/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/style.js"></script>
<script type="text/javascript">
	//点击改变申请单高度
	$(document).ready(function(){
		  $(".more").click(function(){
		    $(this).siblings(".order-li").toggleClass("orderHeight");
		  });
          data(sessionStorage.getItem('lhr_clxq'));
    });


	function data() {
        var rm_code=window.location.href.split("?")[1];
        var sendData = {'type':'b'};
        sendData['remark'] = rm_code;
        sendData['p'] = getP();
        ajaxs("api/supply/materialGySelList.do",'post',sendData,function (data) {
            json = data.data;
            var dd1model = '<dd>'+
                '<div class="erp-txt visa-txt">'+
                '<p class="clearfix"><span class="sp">供料单号:</span><span class="divCon">'+json[0].rm_Code+'</span></p>'+
                '<p class="clearfix"><span class="sp">项目名称:</span><span class="divCon">'+json[0].proName+'</span></p>'+
                '<p class="clearfix"><span class="sp">施工单位:</span><span class="divCon">'+json[0].compName1+'</span></p>'+
              '<p class="clearfix"><span class="sp">送货地址:</span><span class="divCon">'+json[0].r_adr+'</span></p>' +
                '<p class="clearfix"><span class="sp">发货用户:</span><span class="divCon">'+json[0].supCoName+'</span></p>' +
                '{{status}}' +
                '</div>'+
                '</dd>';
//            var dd2model = '<dd>' +
//                '<div class="erp-txt">' +
//
//                '</div>' +
//                '</dd>';

            if(json[0].validate == -1){
                dd1model = dd1model.replace('{{status}}','<p><span>签收状态:</span>等待签收</p>');
            }
            if(json[0].validate == 0){
                dd1model = dd1model.replace('{{status}}','<p><span>签收状态:</span>已签收</p>');
            }
            if(json[0].validate == 0){
                dd1model = dd1model.replace('{{status}}','<p><span>签收状态:</span>拒绝签收</p>');
            }
            $('#dd1').html(dd1model);
//            $('#dd2').html(dd2model);
            var html = '';
            for (var i=0;i<json.length;i++){
				if(json[i].rm_Num==undefined){
                    json[i].rm_Num="";
				}

                var model = '<dd>' +
                    '<p><span>材料名称:</span>'+json[i].mat_Name+'</p>' +
                    '<div class="order-li clearfix">' +
                    '<div class="col-xs-6"><span>材料规格:</span>'+json[i].mat_Spec+'</div>' +
                    '<div class="col-xs-6"><span>计量单位:</span>'+json[i].mat_Bit+'</div>' +
                    '<div class="col-xs-6"><span>审批数量:</span>'+json[i].fin_Num+'</div>' +
                    '<div class="col-xs-6"><span>发货数量:</span>'+json[i].send_Num+'</div>' +
                    '<div class="col-xs-6"><span>签收数量:</span>'+json[i].rm_Num+'</div>' +
                    '<div class="col-xs-6"><span>原价格:</span>'+json[i].old_Price+'￥</div>' +
                    '<div class="col-xs-12"><span>供货地址:</span>'+json[i].r_adr+'</div>' +
//                  '<div class="col-xs-3"><span>单位:</span>'+json[i].mat_Bit+'</div>' +

                    '</div>' +
                    '</dd>'

                html += model;
            }

            $('#dd3').html($('#dd3').html() + html);

        });
    }
</script>











